package com.mythread;

public class Threadd {
    public static void main(String[] args) {
        MyThead m1=new MyThead();
        MyThead m2=new MyThead();
        m1.setName("飞机");
        m2.setName("高铁");
//        MyThead m1=new MyThead("飞机");
//        MyThead m2=new MyThead("高铁");
        m1.start();
        m2.start();
        System.out.println(Thread.currentThread().getName());
    }

}
class MyThead extends  Thread{
    public MyThead(){}
    public MyThead(String name){
        super(name);
        System.out.println(Thread.currentThread().getName());
    }
    public void run(){
        for (int i = 0; i <100 ; i++) {
            System.out.println(i);
            System.out.println(Thread.currentThread().getName());
        }
    }

}
